home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / applications / wp / macro.lha / Macro / SAS / findsym.ged next >
Text File  |  1994-09-05  |  2KB  |  83 lines

  1. /* findsym.ged V1.0 "
  2.    written in 1994 by Leu Simon GRIS
  3.                       10 bis AVE. du Maréchal LECLERC
  4.                       F-63000 Clermont Ferrand
  5.                       France
  6.  
  7.    Description:
  8.    AREXX Script for GoldED
  9.    Search in the Include:gst.all file for the symbol
  10.    under the cursor. If found, load the corresponding
  11.    include file at the right line.
  12.  
  13.    Notes:
  14.    This is mainly based on the findsym.se script provided with
  15.    SAS/C 6.50
  16. */
  17.  
  18. OPTIONS RESULTS                             /* enable return codes     */
  19.  
  20. if (LEFT(ADDRESS(), 6) ~=3D "GOLDED") then    /* not started by GoldEd ? */
  21.     address 'GOLDED.1'
  22.  
  23. 'LOCK CURRENT'                              /* lock GUI, gain access   */
  24. OPTIONS FAILAT 6                            /* ignore warnings         */
  25. SIGNAL ON SYNTAX                            /* ensure clean exit       */
  26.  
  27. /* ------------------------ INSERT YOUR CODE HERE: ------------------- */
  28.  
  29.  
  30. 'QUERY NAME=3DWORD VAR=3Dresult' /* Get current word */
  31.  
  32. OPTIONS
  33. parm =3D result
  34.  
  35. ADDRESS command
  36.  
  37. /* Proceed to the search if there is something under the cursor */
  38. IF (LENGTH(parm) ~=3D 0) THEN
  39. DO
  40.  
  41.   /* Instruct gst to find the symbol */
  42.   'sc:c/gst >t:gstout include:all.gst "' || parm || '"'
  43.  
  44.   gstrc =3D rc
  45.  
  46.   /* Read what gst replyed */
  47.   dummy1 =3D open('gstout','t:gstout','read')
  48.   where  =3D readln('gstout')
  49.   dummy1 =3D close('gstout')
  50.  
  51.   ADDRESS
  52.  
  53.   /* If gst was successfull */
  54.   IF(gstrc =3D=3D 0) then do
  55.     /* Open the file */
  56.     parse var where file dummy1 line dummy2
  57.     'OPEN NAME=3D"' || file || '" NEW FAST'
  58.     window =3D rc
  59.     /* Goto the line */
  60.     'GOTO LINE=3D' || line + 1
  61.     END
  62.   ELSE DO
  63.     'REQUEST PROBLEM=3D"'parm'|Symbol not found"'
  64.   END
  65. END
  66. ELSE
  67. DO
  68.   ADDRESS
  69.   'REQUEST PROBLEM=3D"You must place the|cursor over a symbol"'
  70. END
  71.                                                                         w
  72. /* ---------------------------- END OF YOUR CODE --------------------- */
  73.  
  74. 'UNLOCK' /* VERY important: unlock GUI */
  75. EXIT
  76.  
  77. SYNTAX:
  78.  
  79. SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
  80. 'UNLOCK'
  81. EXIT
  82.  
  83.